package com.tarena.lbs.business.pojo.po;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;

import java.util.Date;

@Data
@ToString
@Document(indexName = "lbs_store")
public class StoreSearchPO {
    
    @Id
    private Integer id; // 自增ID

    @Field(type = FieldType.Integer)
    private Integer businessId; // 商家id

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String storeName; // 门店名称

    @Field(type = FieldType.Keyword)
    private String storePhone; // 门店电话

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String storeHeadName; // 负责人姓名

    @Field(type = FieldType.Keyword)
    private String storeHeadPhone; // 负责人电话

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String storeLocation; // 详细地址

    @Field(type = FieldType.Double)
    private String storeLongitude; // 门店经度

    @Field(type = FieldType.Double)
    private String storeLatitude; // 门店纬度

    @Field(type = FieldType.Keyword)
    private String storeImagesId; // 门店图片id

    @Field(type = FieldType.Keyword)
    private String storeLogo; // 门店logo

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String storeIntroduction; // 门店简介

    @Field(type = FieldType.Integer)
    private Integer sort; // 排序

    @Field(type = FieldType.Text)
    private String tradeTime; // 营业时间

    @Field(type = FieldType.Integer)
    private Integer storeStatus; // 门店状态（是否启用）0 启用  -1禁用

    @Field(type = FieldType.Date)
    private Date createTime; // 创建时间

    @Field(type = FieldType.Date)
    private Date updateTime; // 更新时间

    @Field(type = FieldType.Integer)
    private Integer provinceId; // 所属省级名称

    @Field(type = FieldType.Integer)
    private Integer cityId; // 所属市级名称

    @Field(type = FieldType.Integer)
    private Integer areaId; // 所属区级名称

    @GeoPointField
    private String location; // 格式："纬度,经度"
    
    public String getLocation() {
        return location;
    }
    
    public void setLocation(String location) {
        this.location = location;
    }
}